import store from '@/store'
import _ from "lodash";

export default {
    inserted: (el, binding) => {

        // 节流触发
        // el.onmouseover = _.throttle((event) => {  
        //     if(event.target != el) return
        //     // console.log(binding.value)
        //     store.commit('wife/changeMessage', binding.value)
        // }, 800)

        // el.onmouseout = _.throttle((event) => {
        //     if(event.target != el) return
        //     store.commit('wife/changeMessage', 'live2d YYDS')
        //     // console.log('onmouseout', binding.value)
        // }, 800)

        // 防抖触发
        el.onmouseover = _.debounce((event) => {  
            if(event.target != el) return
            // console.log(binding.value)
            store.commit('wife/changeMessage', binding.value)
        }, 300)

        // el.onmouseout = _.debounce((event) => {
        //     if(event.target != el) return
        //     store.commit('wife/changeMessage', 'live2d YYDS')
        //     // console.log('onmouseout', binding.value)
        // }, 300)
    },
    unbind: (el, binding) => {

    },
    update: (el, binding) => {
        
    }
}